<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{$is_language?'配資商列表':'With the list of investors'}</title>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/weui.min.css">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/jquery-weui.css">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/demos.css">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/example.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.2/style/weui.min.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.0/css/jquery-weui.min.css">
    <script src="__MODULE_LIBS__/js/jquery-2.1.4.js"></script>
    <script src="__MODULE_LIBS__/js/fastclick.js"></script>
    <script src="__MODULE_LIBS__/js/jquery-weui.js"></script>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }

        html {
            width: 100%;
            height: 100%;
            font-size: 20px;
            font-family: "Microsoft YaHei", "宋体", "Segoe UI", "Lucida Grande", Helvetica, Arial, sans-serif, FreeSans, Arimo;
            background: #F3F3F3;
        }

        body {
            margin: 0 auto;
            max-width: 750px;
            height: 100%;
            background: #F7F7F7;
        }

        /*顶部导航栏处的样式*/
        .navbar {
            position: relative;
            width: 100%;
            height: 2rem;
            font-size: 16px;
            color: #fff;
            line-height: 2rem;
            background: #373553;
        }

        .navbar-item {
            position: absolute;
            left: 0;
            top: 0;
            display: block;
            width: 3.2rem;
            height: 2rem;
            font-size: 14px;
            color: #fff;
            text-align: center;
        }

        .navbar-item > img {
            width: 0.8rem;
            height: 0.7rem;
            vertical-align: middle;
        }

        .navbar-center {
            text-align: center;
        }

        /*主体部分的样式*/
        .content {
            width: 100%;
        }

        .weui-grid > input, .weui-grid > select {
            width: 100%;
            height: 1.5rem;
            color: #777;
            border: 1px #d9d9d9 solid;
            outline: none;
            border-radius: 0.3rem;
        }

        .weui-grid > input[type="text"] {
            padding-left: 0.2rem;
            height: 1.4rem;
        }

        .weui-grid > input[type="submit"] {
            font-size: 0.8rem;
            color: #F44444;
            line-height: 1.4rem;
            background: none;
            border: 0;
        }

        .weui-grid option {
            width: inherit;
            text-align: center;
        }

        /*列表处的样式*/
        .weui-cells {
            margin-top: 0.7rem;
            font-size: 0.7rem;
        }

        .weui-cell {
            padding: 0.4rem 0.5rem;
        }

        .weui-cell__ft {
            padding-left: 0.2rem;
            font-size: 0.6rem;
        }

        .pagination > li {
            float: left;
            padding: 2px 6px;
            margin: 0 4px;
            list-style: none;
            color: #fff;
            background: #aaa;
            border-radius: 5px;
        }

        .pagination > li > a {
            color: #fff;
        }

        .pagination > li.active {
            background: #f44444;
        }



        .issueForm > p, .modifyForm > p, .buyForm > p {
            display: block;
            width: 100%;
            height: 1.6rem;
            line-height: 1.6rem;
            margin-top: 0.4rem;
            margin-bottom: 0.3rem;
            text-align: center;
        }

        .issueForm > .visi, .modifyForm > .visi {
            margin-left: 0.25rem;
            text-align: left;
        }

        .issueForm input[type="text"],
        .modifyForm input[type="text"],
        .buyForm input[type="number"],
        .issueForm input[type="datetime"],
        .issueForm input[type="datetime-local"],
        .modifyForm input[type="datetime-local"] {
            padding-left: 0.3rem;
            width: 100%;
            height: 1.4rem;
            border: 0;
            border-bottom: 1px #F44444 solid;
            outline: 0;
        }
        .diya {
            margin-top: 5px;
            background-color: red;
        }
    </style>
</head>
<body ontouchstart>
<header class="navbar">
    {if isset($user)}
    <a href="{:url('goods/index')}" class="navbar-item">
        {else}
        <a href="{:url('goods/index')}" class="navbar-item">
            {/if}
            <img src="__MODULE_LIBS__/img/back.png"/>&nbsp;{$is_language?'返回':'Return'}
        </a>
        <div class="navbar-center">{$is_language?'配資商列表':'With the list of investors'}</div>
        <div class="navbar-item1">
            <select name="" id="yy">
                <option value="1" {$is_language?'selected':''}>中文</option>
                <option value="0" {$is_language?'':'selected'}>English</option>
            </select>
        </div>
</header>
<div class="content">
    <h style="padding: 0.4rem 0.5rem;font-weight: bold;">{$is_language?'請選擇配資商':'Please select a distributor'}:</h>
    {foreach $list as $k=>$vo}
    <div class="weui-cells weui-cells_radio">
        <label class="weui-cell weui-check__label" for="{$vo['id']}">
            <div class="weui-cell__bd">
                <p>{$is_language?'配資商':'With capital business'}：{$vo['username']}</p><p>{$is_language?'日利率':'interest rate'}：{$vo['capital']*100}%</p>
            </div>
            <div class="weui-cell__ft">
                <input class="weui-check" {if $k==0}checked{/if} name="radio1" id="{$vo['id']}" value="{$vo['id']}" type="radio">
                <span class="weui-icon-checked"></span>
            </div>
        </label>
    </div>
    {/foreach}
    <div><a class="weui-btn weui-btn_primary diya" href="javascript:void(0);">{$is_language?'融資':'Financing'}</a></div>
</div>
<input type="hidden" name="yuyan" value="<?php echo @$is_language?>" id="yuyan">
<script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/jquery-weui/1.2.0/js/jquery-weui.min.js"></script>
<script src="https://cdn.bootcss.com/jquery-weui/1.2.0/js/swiper.min.js"></script>
<script src="https://cdn.bootcss.com/jquery-weui/1.2.0/js/city-picker.min.js"></script>
<script type="text/javascript">
    $(document).on("click",'a.diya',function(){
        var id = $("input[name='radio1']:checked").val();
        console.log(id);
        var url = "{:url('capital_ajax')}";
        $.confirm({
            title: '提示(confirm)',
            text: '確認融資？（Confirm financing?）',
            onOK: function () {
                $.post(url,{id:id},function (data) {
                    $.alert({
                        title: '提示(confirm)',
                        text: data.msg,
                        onOK: function () {
                            window.location.href="{:url('lists')}";
                        }
                    })
                })
            }
        });

    });


    $(document).on("change",'select#yy',function(){
        var yy = $(this).val();
        console.log(yy)
        var url = "{:url('index/language')}";
        $.post(url,{language:yy},function (res) {
            window.location.reload();
        })
    });
    $(function () {
        FastClick.attach(document.body);
    })
</script>
</body>
</html>
